//
//  NewFeiLvTableViewCell.m
//  wangzhe
//
//  Created by 李 佳伟 on 2018/3/30.
//  Copyright © 2018年 李 佳伟. All rights reserved.
//

#import "NewFeiLvTableViewCell.h"
#import "JTCSM.h"
#import "MyDoubleLabelView.h"

@interface NewFeiLvTableViewCell ()



@property (nonatomic,strong) MyDoubleLabelView *typeDoubleView;
@property (nonatomic,strong) MyDoubleLabelView *feiLvDoubleView;
@property (nonatomic,strong) MyDoubleLabelView *fanliDoubleView;

@end

@implementation NewFeiLvTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if ([super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        CGFloat cellHeight = 80;
        CGFloat imagesize = 40;
        CGFloat labelHeight = 10;
        CGFloat changeSpace = 8;
        CGFloat space = (KSCREENWidth/4-imagesize)/2;
        
        CGFloat top = (cellHeight-imagesize-changeSpace-labelHeight)/2;
        
        self.logoImageV = [[UIImageView alloc]initWithFrame:CGRectMake(space, top, imagesize, imagesize)];
        self.logoImageV.image = [UIImage imageNamed:@""];
        [self.contentView addSubview:self.logoImageV];
        
        self.nameLabel = [UILabel initWithFrame:CGRectMake(0, KVIEW_Y(self.logoImageV)+changeSpace, KSCREENWidth/4, labelHeight) text:@"" font:12 textAlignment:NSTextAlignmentCenter texcolor:[df colorWithHexString:@"999999" alpha:1] backgroundColor:nil];
        [self.contentView addSubview:self.nameLabel];
        
        self.typeDoubleView = [[MyDoubleLabelView alloc]initWithFrame:CGRectMake(KSCREENWidth/4, 0, KSCREENWidth/4, cellHeight) titleFontsize:14 titlecolor:[df colorWithHexString:@"333333" alpha:1] contentFontsize:14 contentcolor:[df colorWithHexString:@"333333" alpha:1]];
        [self.contentView addSubview:self.typeDoubleView];
        
        self.feiLvDoubleView = [[MyDoubleLabelView alloc]initWithFrame:CGRectMake(KSCREENWidth/2, 0, KSCREENWidth/4, cellHeight) titleFontsize:14 titlecolor:[df colorWithHexString:@"333333" alpha:1] contentFontsize:14 contentcolor:[df colorWithHexString:@"333333" alpha:1]];
        [self.contentView addSubview:self.feiLvDoubleView];
        
        
        self.fanliDoubleView = [[MyDoubleLabelView alloc]initWithFrame:CGRectMake(KSCREENWidth*3/4, 0, KSCREENWidth/4, cellHeight) titleFontsize:14 titlecolor:[df colorWithHexString:@"333333" alpha:1] contentFontsize:14 contentcolor:[df colorWithHexString:@"333333" alpha:1]];
        [self.contentView addSubview:self.fanliDoubleView];
        
    }
    
    return self;
}

- (void)setValueWithModel:(id)model{
    
    NSIndexPath *index = model;
    
    if (index.row%2==0) {
        self.backgroundColor = [UIColor whiteColor];
    }else{
        self.backgroundColor = RGBACOLOR(241, 241, 241, 1);
    }
    
    self.logoImageV.image = [UIImage imageNamed:@"bankcardimage.png"];
    self.nameLabel.text = @"银联云闪付";
    [self.typeDoubleView InsertSpacesetvalueWithModel:@{KDoubleLabelTitle:@"T1",KDoubleLabelContent:@"T0"} changeLabelY:8];
    [self.feiLvDoubleView InsertSpacesetvalueWithModel:@{KDoubleLabelTitle:@"0.60%",KDoubleLabelContent:@"暂不支持"} changeLabelY:8];
    [self.fanliDoubleView InsertSpacesetvalueWithModel:@{KDoubleLabelTitle:@"0.60%",KDoubleLabelContent:@"暂不支持"} changeLabelY:8];
}

@end
